const express = require('express');
let app = new express();
//静态文件中间件
app.use(express.static('public'));
//app.use(function(req, res, next) 使用中间件，调用next方法，将请求传递给下一个中间件
app.use(function(req, res, next) {
    console.log('first middleware!');
    next();
    console.log('first middleware after');
});

app.use(function(req, res, next) {
    console.log('second middleware!');
    next();
});

app.get('/', function(req, res) {
    res.send('拉拉');
});
app.listen(3000, () => console.log('listen at port 3000!'));
